package log

import (
	"log"
	"os"
)

var (
	logFile *os.File
	debugLog *log.Logger
	errorLog *log.Logger
)

func init(){
	logFile, _ = os.OpenFile("debug.log", os.O_RDWR|os.O_CREATE|os.O_APPEND, 0777)
	debugLog = log.New(logFile, "", log.LstdFlags)
	errorLog = log.New(logFile, "Error", log.LstdFlags)
}

func LogPrint(msg string){
	debugLog.Println(msg)
}

func ErrorPrint(msg string){
	errorLog.Println(msg)
}

//func LogNewQuestion(question *unti.Question){
//	debugLog.Println(question.Title, time.Now())
//	opts:=make([]string,len(question.Options))
//	for i,o:=range question.Options{
//		opts[i]=o.Text
//	}
//	debugLog.Println(strings.Join(opts,"; "), time.Now())
//}
